

import requests

# if __name__ =='__main__':
headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)'
                      ' Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.76'
    }
url = 'https://www.baidu.com/s?wd=IP'
pagr_text = requests.get(url = url,headers=headers,proxies={"http":'222.110.147.50'}).text
with open('ip.html','w',encoding='utf-8') as fp:
    fp.write(str(pagr_text))
